<template>
  <div class="box">
    <!-- 轮播图 -->
    <swiper :lunbotulist="lunbotulist" :isfull="true"></swiper>
    <!-- 六宫格 -->
    <van-grid :column-num="3">
      <van-grid-item v-for="(lst,index) in list" :key="index" :icon="lst.url" :text="lst.text" :to="lst.goto"/>
    </van-grid>
  </div>
</template>

<script>
import swiper from "../subcomponents/swipervue"
export default {
  data() {
    return {
      lunbotulist: [],
       list: [
        { text: "新闻资讯", url: "location",goto:"/Home/Newslist"},
        { text: "图片分享", url: "like",goto:"/Home/Photolist" },
        { text: "商品购买", url: "star",goto:"/Home/GoodList" },
        { text: "留言反馈", url: "service",goto:"" },
        { text: "视屏专区", url: "gold-coin",goto:"" },
        { text: "联系我们", url: "thumb-circle",goto:"" }
      ]
    };
  },
  created() {
    this.getLunbotu();
  },
  methods: {
    getLunbotu() {
      this.$ajax
        .request({ url: "http://www.liulongbin.top:3005/api/getlunbo",method:'GET'})
        .then(ret => {
          if (ret.data.status === 0) {
            this.lunbotulist = ret.data.message;
          } else {
            Toast("加载轮播图失败。。。");
          }
        });
    }
  },
  components:{
    swiper
  }
};
</script>

<style scoped>
.box{
  margin-top: 46px;
}
</style>